﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ShopOrder_json.aspx.cs" Inherits="newBlog.CenterInc.view_json.ShopOrder_json" %>

<%@ Import Namespace="newBlog.CenterInc.model" %>
<%@ Import Namespace="newBlog.CenterInc.Ctrltor" %>
<%@ Import Namespace="System.Web.Script.Serialization" %>
<%

    Response.ContentType = "application/json";
    if (Session["user_id"]==null) {
        Response.Write("{\"error\":\"您未登录本站\"}");
        return;
    }
    string user_id = Convert.ToInt32(Session["user_grade"])==1?(Request.Form["user_id"]==null||Request.Form["user_id"].Length==0)?"":Request.Form["user_id"]:Session["user_id"].ToString();
    int page = Request.Form["page"]==null?0:(Convert.ToInt32(Request.Form["page"])-1)*20;
    string minPrice = (Request.Form["minPrice"] == null || Request.Form["minPrice"].Length == 0) ? "" : Request.Form["minPrice"];
    string maxPrice = (Request.Form["maxPrice"] == null || Request.Form["maxPrice"].Length == 0) ? "" : Request.Form["maxPrice"];
    string minTime = (Request.Form["minTime"] == null || Request.Form["minTime"].Length == 0) ? "" : Request.Form["minTime"];
    string maxTime = (Request.Form["maxTime"] == null || Request.Form["maxTime"].Length == 0) ? "" : Request.Form["maxTime"];
    string order_id = (Request.Form["order_id"] == null || Request.Form["order_id"].Length == 0) ? "" : Request.Form["order_id"];
    Pay_inc pay_Inc = new Pay_inc();
    int count = pay_Inc.getOrder_Count(user_id,minPrice,maxPrice,minTime,maxTime,order_id);
    JavaScriptSerializer serializer = new JavaScriptSerializer();
    List<Recharge_shopDao> list = pay_Inc.getShop_items(user_id,minPrice,maxPrice,minTime,maxTime,order_id,page);
    string json = "{\"code\":0,\"msg\":\"\",\"count\":"+count+",\"data\":"+serializer.Serialize(list)+"}";
    Response.Write(json);
    %>
